export default {
    param: [
        // 特殊类型，Primary 在初始化时，会传入对应参数，如果不传，默认从-1 开始递减，并且多个对象不重复
        { key: 'id', label: '主键', type: 'Primary' },
        {
            key: 'name', label: '名称', type: 'String', allowClear: true, default: '默认名称', readonly: true, required: true, description: `一大堆说明文字/并且计算折行`, size: 'small',
            Rule: { Error: '必须为整数', RegExp: "^\\d+$" },
            // 事件属性
            Event: {
                // 监听事件，改变当前值,一个字段对应一组监听程序
                Wacth: 'state + 1',
                // 显示隐藏事件（此项不编写时，默认为展示状态）
                Enable: 'state == 0',
                // 参数属性值改变事件
                ParamOption: {
                    'state == 0': { readonly: false, required: true, label: '经度' },
                    'state == 1': { readonly: true, required: true, label: 'longitude' },
                    'state != 1 && state != 0': { readonly: false, required: false, label: 'lalal' },
                },
            }
        },
        {
            key: 'state', label: '状态', allowClear: true, type: 'Select', default: 0, description: `一大堆说明文字/并且计算折行`, size: 'small',
            // 组件自定义属性值 字典
            // 支持字符串获取字典，
            // 支持异步获取字典，
            // 支持编写固定字典，
            // 支持多级联动
            Dict: [{ value: 0, label: '状态1' }, { value: 1, label: '状态2' }, { value: 2, label: '状态3' }]
        },
        {
            key: 'position', label: '经纬度', type: 'Position', description: `一大堆说明文字`, size: 'small',
            // 单个表单元素对应多个 Key 值的情况
            MultiKeyDefault: [
                { FormKey: 'longitude', ValueKey: 'longitude', default: null, },
                { FormKey: 'latitude', ValueKey: 'latitude', default: null, },
            ],
            // 组件自定义属性值
            showType: 'Degree', // Degree:度分秒显示 / Number:角度值显示
        },
        { key: 'Tree', label: '第一级联动', type: 'Select', default: 1, size: 'small', Dict: 'Tree' },
        { key: 'TreeChild', label: '第二级联动', type: 'Select', Dict: 'Tree:children:null', size: 'small', },
        { key: 'TreeChildChild', label: '第三级联动', type: 'Select', Dict: 'TreeChild:children:0', size: 'small', },
        { key: 'isbyte', isbyte: true, label: '二进制多选', type: 'Select', default: 3, Dict: 'isbyte', size: 'small', },
        { key: 'int', label: '正整数', type: 'Number', unit: '°', step: 1, max: 100, min: 0, precision: 0, },
        { key: 'Number', label: '正常小数', type: 'Number', unit: '°', },
        {
            key: 'RadioState', label: '单选框', type: 'Radio', default: 0,
            Dict: [{ value: 0, label: '状态1' }, { value: 1, label: '状态2' }, { value: 2, label: '状态3' }]
        },
        { key: 'CheckBox', label: '测试CheckBox', type: 'CheckBox', default: false },
        {
            key: 'CheckBoxGroup', isbyte: true, label: 'checkbox多选', type: 'CheckBoxGroup', default: 3, description: `一大堆说明文字/并且计算折行`, size: 'small',
            Dict: [{ code: 1, title: '状态1' }, { code: 2, title: '状态2' }, { code: 4, title: '状态3' }],
            DictOption: { labelKey: 'title', valueKey: 'code' },
        },
        {
            key: 'CheckBoxGroup2', label: 'checkbox多选', type: 'CheckBoxGroup', default: [], description: `一大堆说明文字/并且计算折行`, size: 'small',
            Dict: [{ code: 1, title: '状态1' }, { code: 2, title: '状态2' }, { code: 4, title: '状态3' }],
            DictOption: { labelKey: 'title', valueKey: 'code' },
        },
        {
            key: 'Frequency', label: '频率', type: 'DoubleNumber', unit: 'MHz', inputLabel: ['起', '止'], size: 'small',
            MultiKeyDefault: [
                { FormKey: 'Star', ValueKey: 'Star', default: null, },
                { FormKey: 'End', ValueKey: 'End', default: null, },
            ],
        },
        { key: 'Textarea', label: '名称', type: 'Textarea', default: '默认名称', minRows: 3, maxRows: 5, readonly: true, required: true, size: 'small', },
        { key: 'Cascader', label: '级联选择', type: 'Cascader', default: [1, 11], required: true, size: 'small', Dict: 'Tree' },
        { key: 'TimePicker', label: '日期选择', type: 'TimePicker', default: null, size: 'small', dateFormat: 'YYYY-MM-DD' },
        { key: 'Swith', label: '开关', type: 'Swith', default: false, size: 'small' },
    ],
    view: {
        type: 'Layout.FormLayout',
        options: { labelCol: { style: { width: '150px' } } },
        slots: {
            default: [{
                type: 'Layout.FormGroup', options: {}, slots: {
                    default: [
                        'Tree',
                        'TreeChild',
                        "int",
                        'Number',
                        {
                            type: 'Layout.RowGroup', options: { ColArray: [16, 8, 8, 16], RowGutter: 16 }, slots: {
                                Col_0: ['name'],
                                Col_1: ['state'],
                                Col_2: ['position'],
                                Col_3: ['TimePicker'],
                            }
                        },
                        'TreeChildChild',
                        'RadioState',
                        'Swith',
                        'NoLabelWidth:CheckBox',
                        {
                            type: 'Layout.RowGroup', options: { ColArray: [7, 3, 8], RowGutter: 16 }, slots: {
                                Col_0: ['NoLabel:CheckBox'],
                                Col_1: ['NoLabelWidth:CheckBox'],
                                Col_2: ['Frequency']
                            }
                        },
                        'CheckBoxGroup',
                        'CheckBoxGroup2',
                        'Frequency',
                        'Textarea',
                        'Cascader',
                    ]
                }
            }, {
                type: 'Layout.FormGroup', options: {}, slots: { default: ['isbyte'] }
            }, {
                type: 'Layout.LabelFormGroup', options: {}, slots: {
                    label: ['NoLabelWidth:CheckBox'],
                    default: ['NoLabelWidth:CheckBoxGroup'],
                }
            }]
        }
    },

    // view: {
    //     type: 'Layout.TestLayout',
    //     options: { labelCol: { style: { width: '100px' } } },
    //     slots: {
    //         default: [{
    //             type: 'Layout.FormGroup', options: { title: '地理信息', }, slots: { default: ['name', 'state', 'position'] }
    //         }],
    //     },
    // },
}

